<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <style>
    * {
      margin: 0px;
    }
    div {
      display: inline-block;
    }
    .outerDiv {
      width: 160px;
      height: 400px;
      background-color: pink;
    }
    .upperDiv {
      width: 50px;
      height: 50px;
      background-color: red;
    }
    .downDiv {
      width: 50px;
      height: 50px;
      background-color: green;
    }
    #targetDiv {
      margin-right: 30px;
    }
    #targetRightDiv {
      margin-left: 20px;
    }
    </style>
    <link href="css/style.css" rel="stylesheet">
  </head>
  <body>
    <div class="outerDiv" id="originDiv">
      <!-- 两个行内块为什么会有间隙？ -->
      <div class="upperDiv"></div>
      <div class="downDiv"></div>
    </div>
    <div class="outerDiv">
      <div class="upperDiv" id="targetDiv"></div>
      <div class="downDiv" id="targetRightDiv"></div>
    </div>
    <hr>
    我们是50px的正方形，你出20左外边距，我出30右外边距。我们边距没合并，间隙看起来像50px
  
  </body>
</html>
